package com.neural.metric;

public enum MetricManager {

	EUCLIDES_METRIC("euclides", new EuclidesMetric()), 
	MANHATTAN_METRIC("manhattan", new ManhattanMetric()), 
	MAXIMUM_METRIC("maximum", new MaximumMetric()), 
	MINIMUM_METRIC("minimum", new MinimumMetric());

	private MetricManager(String name, Metric metric) {
		this.name = name;
		this.metric = metric;
	}

	public static Metric getMetricFromName(String name) {
		for (MetricManager metricManager : values()) {
			if (metricManager.name.equals(name)) {
				return metricManager.metric;
			}
		}
		return null;
	}

	private final String name;
	private final Metric metric;
}
